import request from '@/utils/request'
// 行政复议相关审批表 API接口
const apl_admre_auditApi = {
    list: '/apl_admre_audit/list',
    save: '/apl_admre_audit/save',
    view: '/apl_admre_audit/view',
    updatesIscitymanager: '/apl_admre_audit/updatesIscitymanager', // 更新市领导审批字段
    getLastChildAudit: '/apl_admre_audit/getLastChildAudit', // 获取最新一条子流程记录
    findAllAuditList: '/apl_admre_audit/findAllAuditList' // 查询全部的流程记录
}
/**
 * 查看、编辑行政复议相关审批表
 * @param {*} id
 */
export function viewApl_admre_audit (id) {
    return request({
        url: apl_admre_auditApi.view,
        method: 'get',
        params: {id}
    })
}
/**
 * 保存行政复议相关审批表
 * @param {*} body
 */
export function saveApl_admre_audit (body) {
    return request({
        url: apl_admre_auditApi.save,
        method: 'post',
        data: body
    })
}
/**
 * 查询行政复议相关审批表列表
 * @param {*} body
 */
export function queryApl_admre_auditList (body) {
    return request({
        url: apl_admre_auditApi.list,
        method: 'post',
        data: body
    })
}

/**
 * 更新是否市领导审批字段
 * @param {*} params
 * @returns
 */
export function updatesIscitymanager (id, iscitymanager) {
    return request({
      url: apl_admre_auditApi.updatesIscitymanager,
      method: 'post',
      params: { 'id': id, 'iscitymanager': iscitymanager }
    })
}


/**
 * 获取最新一条子流程记录
 * @param {*} parentApplyid
 * @param {*} procType
 * @returns
 */
export function getLastChildAudit (parentApplyid, procType) {
    return request({
        url: apl_admre_auditApi.getLastChildAudit,
        method: 'post',
        params: { 'parentApplyid': parentApplyid, 'procType': procType }
    })
}

/**
 * 查询全部的子流程记录
 * @param {} applyid applyid
 * @returns
 */
export function findAllAuditList (applyid) {
    return request({
        url: apl_admre_auditApi.findAllAuditList,
        method: 'post',
        params: { 'applyid': applyid }
    })
}